home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / hplip / ui4 / systrayframe.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  3.9 KB  |  101 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from base.g import *
  5. from base.codes import *
  6. from ui_utils import *
  7. from PyQt4.QtCore import *
  8. from PyQt4.QtGui import *
  9.  
  10. class SystrayFrame(QFrame):
  11.     
  12.     def __init__(self, parent):
  13.         QFrame.__init__(self, parent)
  14.  
  15.     
  16.     def initUi(self, systray_visible, polling, polling_interval, device_list):
  17.         self.systray_visible = systray_visible
  18.         self.polling = polling
  19.         self.polling_interval = polling_interval
  20.         self.device_list = device_list
  21.         self.GridLayout = QGridLayout(self)
  22.         self.GridLayout.setObjectName('GridLayout')
  23.         self.GroupBox2 = QGroupBox(self)
  24.         self.GroupBox2.setObjectName('GroupBox2')
  25.         self.GridLayout2 = QGridLayout(self.GroupBox2)
  26.         self.GridLayout2.setObjectName('GridLayout2')
  27.         self.ShowAlwaysRadioButton = QRadioButton(self.GroupBox2)
  28.         self.ShowAlwaysRadioButton.setObjectName('ShowAlwaysRadioButton')
  29.         self.GridLayout2.addWidget(self.ShowAlwaysRadioButton, 0, 0, 1, 1)
  30.         self.HideWhenInactiveRadioButton = QRadioButton(self.GroupBox2)
  31.         self.HideWhenInactiveRadioButton.setObjectName('HideWhenInactiveRadioButton')
  32.         self.GridLayout2.addWidget(self.HideWhenInactiveRadioButton, 1, 0, 1, 1)
  33.         self.HideAlwaysRadioButton = QRadioButton(self.GroupBox2)
  34.         self.HideAlwaysRadioButton.setObjectName('HideAlwaysRadioButton')
  35.         self.GridLayout2.addWidget(self.HideAlwaysRadioButton, 2, 0, 1, 1)
  36.         self.GridLayout.addWidget(self.GroupBox2, 0, 0, 1, 1)
  37.         self.GroupBox = QGroupBox(self)
  38.         self.GroupBox.setCheckable(True)
  39.         self.GroupBox.setObjectName('GroupBox')
  40.         self.GridLayout3 = QGridLayout(self.GroupBox)
  41.         self.GridLayout3.setObjectName('GridLayout3')
  42.         self.label = QLabel(self.GroupBox)
  43.         self.label.setObjectName('label')
  44.         self.GridLayout3.addWidget(self.label, 0, 0, 1, 1)
  45.         self.DevicesListWidget = QListWidget(self.GroupBox)
  46.         self.DevicesListWidget.setObjectName('DevicesListWidget')
  47.         self.GridLayout3.addWidget(self.DevicesListWidget, 1, 0, 1, 1)
  48.         self.GridLayout.addWidget(self.GroupBox, 1, 0, 1, 1)
  49.         self.GroupBox2.setTitle(self._SystrayFrame__tr('System tray icon visibility'))
  50.         self.ShowAlwaysRadioButton.setText(self._SystrayFrame__tr('Always show'))
  51.         self.HideWhenInactiveRadioButton.setText(self._SystrayFrame__tr('Hide when inactive'))
  52.         self.HideAlwaysRadioButton.setText(self._SystrayFrame__tr('Always hide'))
  53.         self.GroupBox.setTitle(self._SystrayFrame__tr('Monitor button presses on devices'))
  54.         self.label.setText(self._SystrayFrame__tr('Devices to Monitor:'))
  55.         self.connect(self.ShowAlwaysRadioButton, SIGNAL('clicked(bool)'), self.ShowAlwaysRadioButton_clicked)
  56.         self.connect(self.HideWhenInactiveRadioButton, SIGNAL('clicked(bool)'), self.HideWhenInactiveRadioButton_clicked)
  57.         self.connect(self.HideAlwaysRadioButton, SIGNAL('clicked(bool)'), self.HideAlwaysRadioButton_clicked)
  58.         self.GroupBox.setEnabled(False)
  59.  
  60.     
  61.     def updateUi(self):
  62.         self.updateVisibility()
  63.         self.updateDeviceList()
  64.  
  65.     
  66.     def updateVisibility(self):
  67.         if self.systray_visible == SYSTRAY_VISIBLE_SHOW_ALWAYS:
  68.             self.ShowAlwaysRadioButton.setChecked(True)
  69.         elif self.systray_visible == SYSTRAY_VISIBLE_HIDE_WHEN_INACTIVE:
  70.             self.HideWhenInactiveRadioButton.setChecked(True)
  71.         else:
  72.             self.HideAlwaysRadioButton.setChecked(True)
  73.  
  74.     
  75.     def ShowAlwaysRadioButton_clicked(self, b):
  76.         if b:
  77.             self.systray_visible = SYSTRAY_VISIBLE_SHOW_ALWAYS
  78.         
  79.  
  80.     
  81.     def HideWhenInactiveRadioButton_clicked(self, b):
  82.         if b:
  83.             self.systray_visible = SYSTRAY_VISIBLE_HIDE_WHEN_INACTIVE
  84.         
  85.  
  86.     
  87.     def HideAlwaysRadioButton_clicked(self, b):
  88.         if b:
  89.             self.systray_visible = SYSTRAY_VISIBLE_HIDE_ALWAYS
  90.         
  91.  
  92.     
  93.     def updateDeviceList(self):
  94.         pass
  95.  
  96.     
  97.     def __tr(self, s, c = None):
  98.         return QApplication.translate('SystrayFrame', s, c, QApplication.UnicodeUTF8)
  99.  
  100.  
  101.